<template>
	<Layout class="p-5 bg-white">
		<Form :label-width="80">
			<FormItem class="w-50" label="编号">
				<label>{{client.clientId}}</label>
			</FormItem>
			<FormItem class="w-50" label="名称">
				<label>{{client.name}}</label>
			</FormItem>
			
			<FormItem class="w-50" label="账户">
				<label>{{client.account}}</label>
			</FormItem>
			
			<FormItem class="w-50" label="密码">
				<label>{{client.password}}</label>
			</FormItem>
			
			<FormItem class="w-50" label="性别">
				<label v-if="client.sex == '1'">{{"男"}}</label>
				<span v-else>{{"女"}}</span>
			</FormItem>
			
			<FormItem class="w-50" label="头像">
				<img v-if="client.headImg" 
				style="width: 50px; height: 50px; border-radius: 25px;" :src="'https://'+client.headImg" />
				<span v-else>无</span>
			</FormItem>
			
			<FormItem class="w-50" label="年龄">
				<label>{{client.age}}</label>
			</FormItem>
			
			<FormItem class="w-50" label="开始编号">
				<label>{{client.openId}}</label>
			</FormItem>
			
			<FormItem class="w-50" label="cu">
				<label>{{client.cu}}</label>
			</FormItem>
			
			<FormItem class="w-50" label="ct">
				<label>{{client.ct}}</label>
			</FormItem>
			
			<FormItem class="w-50" label="uu">
				<label>{{client.uu}}</label>
			</FormItem>
			
			<FormItem class="w-50" label="ut">
				<label>{{client.ut}}</label>
			</FormItem>
	
			
			<FormItem class="text-right">
				<Button @click="cancel" class="ml-2">取消</Button>
			</FormItem>
		</Form>
	</Layout>
</template>

<script>
	export default {
		data() {
			return {
				client: {
					clientId: "",
					name: "",
					account: "",
					password: "",
					sex: "",
					headImg: "",
					age: "",
					openId: "",
					cu: "",
					ct: "",
					uu: "",
					ut: "",
				},
			}
		},
		methods: {
			cancel: function() {
				this.$tabs.close();
				
				this.message.info("取消成功，已返回");
				
			},
			
			
			init: function() {
				let self = this;
				self.http.get({
					url: "/client/info",
					param: {
						clientId: self.client.clientId,
					}
				}).then(data => {
					self.$data.client = data;
					self.$data.client.headImg = data.client.headImg;
				})
				
			},
		},
		created: function () {
			this.client.clientId = this.$route.query.clientId;
			this.init();
		}
	}
</script>